Rooms
note you can use v chat test server base url is
http://170.178.195.150:81/api/v1/
1 - get rooms and loadMore (single and group chat supported)
- URL: {{baseUrl}}room?page=0
- Method: GET
- Content-Type: JSON
- Authentication: Bearer token is required in header in
authorization : Bearer yourToken
- Example request data in query param put:
{
"page":0
}
Parameter | Required | Description |
---|---|---|
page | true | 0 mean first 20 room next 20 you need to add one and call same api |
Example response:
{
"success": true,
"data": [
{
"_id": "61cd92223bd8731be040e11e",
"blockerId": null,
"groupSetting": null,
"updatedAt": 1640862250276,
"creatorId": "61cd8fb33bd8731be040e103",
"roomType": "single",
"lastMessage": {
"_id": "61cd922a3bd8731be040e138",
"messageType": "text",
"messageAttachment": null,
"createdAt": 1640862250273,
"content": "first",
"senderId": "61cd8fb33bd8731be040e103",
"senderName": "user1 updated name",
"senderImageThumb": "REGISTER_3c651b24-3912-4191-a131-af99292a75f9_THUMB.jpg",
"roomId": "61cd92223bd8731be040e11e"
},
"isOnline": 0,
"title": "user2",
"peerId": "61cd8ff33bd8731be040e108",
"peerEmail": "user2",
"thumbImage": "default_user_image.png",
"ifPeerReadMyLastMessage": 0,
"unReadCount": 0,
"roomMembersCount": 2,
"isMute": 0
}
]
}
blockerId
is null this mean no one block the other if it contains id then the user id is the blocker it will always null for group chatgroupSetting
will always null for single chat group chat will contain its data which
{
"name":"group title",
"roomMembersCount": 11,
"role": "admin",
"isGroupCreator": false,
"imageThumb": "group image .png"
}
2 - Mute notifications (single and group chat supported)
- URL: {{baseUrl}}room/chat-notification
- Method: POST
- Content-Type: JSON
- Authentication: Bearer token is required in header in
authorization : Bearer yourToken
- Example request data:
{
"id": "xxx"
}
Parameter | Required | Description |
---|---|---|
id | true | room id |
Example response:
{
"success": true,
"data": "done successfully"
}
3 - Ban user (single supported)
- URL: {{baseUrl}}room/ban-chat-user
- Method: POST
- Content-Type: JSON
- Authentication: Bearer token is required in header in
authorization : Bearer yourToken
- Example request data:
{
"peerId": "xxx"
}
Parameter | Required | Description |
---|---|---|
peerId | true | peer user id |
Example response:
{
"success": true,
"data": "done successfully"
}